package com.aloha.springframework.test.bean;

import com.aloha.springframework.beans.BeansException;
import com.aloha.springframework.beans.factory.config.BeanPostProcessor;

/**
 * @author DaiZhiHeng
 * @date 2023/7/3 10:06
 */
public class UserDaoBeanPostProcessor implements BeanPostProcessor {

    @Override
    public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
        //if (bean instanceof UserDao) {
        System.out.println("=================> " + beanName + " 执行BeanPostProcessor");
        //}
        return bean;
    }

    @Override
    public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
        return bean;
    }
}
